package com.jungle.common.core.domain.entity;

import com.jungle.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Data
@EqualsAndHashCode(callSuper = false)
@Entity
@Table(name = "user")
@org.hibernate.annotations.Table(appliesTo = "user", comment = "用户信息表")
@Where(clause = "deleted is null or deleted != true")
@SQLDelete(sql = "update user set deleted = true where id = ? ")
public class MyUser extends BaseEntity {

    //微信用户唯一标识
    @Comment("微信用户唯一标识")
    @Column(name = "openid")
    private String openid;

    //昵称
    @Comment("昵称")
    @Column(name = "nick_name",unique = true)
    private String nickName;

    //真实姓名
    @Comment("真实姓名")
    @Column(name = "real_name")
    private String realName;

    //手机号
    @Comment("手机号")
    @Column(name = "phone_number",unique = true)
    private String phoneNumber;

    //密码
    @Comment("密码")
    @Column(name = "password")
    private String password;

    //性别 false 男 true 女
    @Comment("性别 0 男 1 女")
    @Column(name = "sex")
    private Integer sex;

    //身份证号
    @Comment("身份证号")
    @Column(name = "id_number")
    private String idNumber;

    //头像
    @Comment("头像")
    @Column(name = "avatar")
    private String avatar;

    //住址
    @Comment("住址")
    @Column(name = "address")
    private String address;

    //偏好
    @Comment("偏好")
    @Column(name = "hobby")
    private String hobby;

    //个性签名
    @Comment("个性签名")
    @Column(name = "personality")
    private String personality;

    //状态 0锁定 1启用
    @Comment("状态 0锁定 1启用")
    @Column(name = "status")
    private Integer status=1;

    //关注数量
    @Comment("关注数量")
    @Column(name = "concern_num")
    private Integer concernNum;

    //粉丝数量
    @Comment("粉丝数量")
    @Column(name = "fan_num")
    private Integer fanNum;

    //主页背景图片
    @Comment("主页背景图片")
    @Column(name = "background_img")
    private String backgroundImg;



    //邮箱
    @Comment("邮箱")
    @Column(name = "email")
    private String email;

}
